<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<jsp:include page="../header.jsp">
<jsp:param value="学员来源" name="title"/>
</jsp:include>
<script src="static/js/slq/source.js" type="text/javascript"></script>
<link href="static/css/slq/source.css" rel="stylesheet" type="text/css">

</head>
<body>

<div class = "gps">
<a class = "home" href="staff?method=forward">首页</a>
<sapn> > </sapn>
<a href="source">学员来源</a>
</div>
	<div class="teacher-content">
		<div class="searcher">
			<form>
				<div class="ui form">
					<div class="fields">
							<div class="field">
							<label>&nbsp</label> 
					        <input type="text" name="sourceName" value="${param.sourceName }" placeholder="检索来源"> 
					        </div>
					     <div class="field">
							<label>&nbsp;</label>
							<button class="ui green button">
							<i class="search icon"></i>
							检索</button>
						</div>
					</div>
				</div>
			</form>
		</div>
		<div>
			<div class="ui buttons">
				<a onclick="addsource() " class="ui green button"> <i class="icon add"></i>
					添加来源
				</a>
				
				<button class="ui red button" id="delete">
					<i class="icon trash"></i> 删除来源
				</button>
			</div>
		</div>
		<table class="ui celled striped table">
			<thead>
				<tr>
					<th colspan="4">学员来源列表</th>
				</tr>
			</thead>
			<tbody>

				<tr>
					<td class="collapsing">
						<div class="ui checkbox">
							<input type="checkbox" id="checkAll" >
						</div>
					</td>
					<td >学员来源</td>
					<td>&nbsp;</td>
				</tr>
				 <c:forEach items="${sourceNameList }" var="source">
					   <tr>
						<td class="collapsing">
							<div class="ui checkbox">
								<input class="item-check" type="checkbox" value="${source.sourceId}">
							</div>
						</td>
						<td>${source.sourceName}</td>
						<td class="collapsing">
						<a  class="ui red button" href="../business/source/delete?id=${source.sourceId}" onclick="return confirm('确认删除？')" ">
						<i class="icon trash"></i> 删除
						</a>
						</td>
					</tr>	
			</c:forEach>
			</tbody>
		</table>
	</div>
	<br>
<div class="ui left floated pagination menu" id = "positpage">
  	<c:if test="${totalPage > 1 }">
			<div class="page">
				<a <c:if test="${page!=1}">href="source?page=1${queryString}"</c:if>
					class="${page == 1?'disable':''}">首页</a> <a
					<c:if test="${page!=1}">href="source?page=${page-1}${queryString}"</c:if>
					class="${page == 1?'disable':''}">上一页</a> <a
					<c:if test="${page!=totalPage}">href="source?page=${page+1 }${queryString}"</c:if>
					class="${page == totalPage?'disable':''}">下一页</a> <a
					<c:if test="${page!=totalPage}">href="source?page=${totalPage }${queryString}"</c:if>
					class="${page == totalPage?'disable':''}">尾页</a> <span>
					${page}/${ totalPage} </span>
			</div>
		</c:if>
	</div>

<!--创建部门的弹出层  -->
<div class="ui modal" id = "addsource">
  <div class="header">
  	 添加来源
  </div>
 <div class="teacher-content">
		<form  method="post" class="ui form create-form" action = "addsource">
		  <div class="field">
		    <label>学员来源</label>
		    <input type="text" name="SourceName">
		  </div>
		<div class="actions">
		   <div class="ui red deny button">取消</div>
		   <button class="ui green button">确认<i class="checkmark icon"></i></button>
  		</div> 
		</form>
	</div>  
</div>

</body>
</body>
</html>